package com.aikon.wht.spring;

import com.aikon.wht.mongo.MongoDBConfigService;
import org.apache.commons.collections.comparators.BooleanComparator;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;
import org.springframework.core.io.DefaultResourceLoader;
import org.springframework.core.io.Resource;
import org.springframework.util.comparator.ComparableComparator;

public class TestOfSpring {

	public static void main(String args[]) {
		System.out.println(true ^ true);
		System.out.println(true ^ false);

		System.out.println(new BooleanComparator(true).compare(false, true));
		System.out.println(new BooleanComparator(false).compare(true, false));

		System.out.println(new ComparableComparator<String>().compare("ca", "bb"));


		AbstractApplicationContext applicationContext = new FileSystemXmlApplicationContext("**/webapp/**/source-servlet.xml");
		MongoDBConfigService mongoDBConfigService = applicationContext.getBean(MongoDBConfigService.class);
		System.out.println(applicationContext.getClassLoader());
		mongoDBConfigService.getMongoClient();
		applicationContext.registerShutdownHook();

//		Resource resource = new DefaultResourceLoader().getResource("**/source-servlet.xml");
//		System.out.println(resource.getDescription());
//		System.out.println(applicationContext.getResource("**/source-servlet.xml").getDescription());
	}

}
